package com.bcbim.operation_maintenance.space_category.mapper;

import com.bcbim.operation_maintenance_interface.space.dto.SpaceDTO;
import com.bcbim.operation_maintenance_interface.space_category.dao.SpaceCategoryDAO;
import com.bcbim.operation_maintenance_interface.space_category.vo.ListSpaceCategoryTreeVO;
import com.bcbim.operation_maintenance_interface.space_category.vo.ListSpaceCategoryVO;
import com.bcbim.operation_maintenance_interface.space_category.vo.SpaceCategoryTreeVO;
import com.bcbim.operation_maintenance_interface.space_category.vo.SpaceCategoryVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @version V 1.0.0
 * @Description：空间类别mapper
 * @Author: haomeijie
 * @Date: 2022/3/4 17:43
 **/
@Mapper
public interface SpaceCategoryMapper {
    /**
     * 新增空间类别
     *
     * @param spaceCategoryDAO
     * @return int
     * @Author: haomeijie
     * @Date: 2022/3/4 17:30
     */
    int insertSpaceCategory(SpaceCategoryDAO spaceCategoryDAO);

    /**
     * 修改空间类别
     *
     * @param spaceCategoryDAO
     * @return int
     * @Author: haomeijie
     * @Date: 2022/3/4 17:30
     */
    int updateSpaceCategory(SpaceCategoryDAO spaceCategoryDAO);

    /**
     * 查看空间类别详情
     *
     * @param id
     * @return SpaceCategoryVO
     * @Author: haomeijie
     * @Date: 2022/3/4 17:35
     */
    SpaceCategoryVO getSpaceCategory(String id);

    /**
     * 查询空间类别-类型
     *
     * @return List<SpaceCategoryTreeVO>
     * @Author: haomeijie
     * @Date: 2022/3/8 17:13
     */
    List<SpaceCategoryTreeVO> listSpaceCategoryTree(String projectId);

    /**
     * 检查空间类别名称是否重复
     *
     * @return List<SpaceCategoryTreeVO>
     * @Author: xuehao
     * @Date: 2022/3/8 17:13
     */
    int checkSpaceCategory(@Param("spaceCategory") String spaceCategory, @Param("projectId") String projectId, @Param("id") String id);


    /**
     * 根据类别-类型查询空间信息
     *
     * @param spaceDTO
     * @return List<ListSpaceCategoryVO>
     * @Author: haomeijie
     * @Date: 2022/3/10 13:59
     */
    List<ListSpaceCategoryTreeVO> listSpaceByCategory(SpaceDTO spaceDTO);

    /**
     * 类别-类型列表
     *
     * @param name
     * @param projectId
     * @return List<ListSpaceCategoryVO>
     * @Author: haomeijie
     * @Date: 2022/3/22 18:06
     */
    List<ListSpaceCategoryVO> listSpaceCategory(@Param("name") String name, @Param("projectId") String projectId);

    /**
     * 根据筛选条件查询类别
     *
     * @param spaceDTO
     * @return List<ListSpaceCategoryTreeVO>
     * @Author: haomeijie
     * @Date: 2022/3/30 9:42
     */
    List<ListSpaceCategoryTreeVO> selectCategoryBySpace(SpaceDTO spaceDTO);

    /**
     * 查询类别类型（包含统计绑定过的空间个数）【修改后】
     *
     * @param spaceDTO
     * @return List<ListSpaceCategoryTreeVO>
     * @Author: haomeijie
     * @Date: 2022/4/2 13:22
     */
    List<ListSpaceCategoryTreeVO> listCategoryByQuery(SpaceDTO spaceDTO);

    //全部类别类型
    List<ListSpaceCategoryTreeVO> listCategory(SpaceDTO spaceDTO);

    /**
     * 获取未指派id
     *
     * @param unassignedName
     * @param projectId
     * @return String
     * @Author: haomeijie
     * @Date: 2022/4/6 16:50
     */
    String getUnassignedId(@Param("unassignedName") String unassignedName, @Param("projectId") String projectId);

    /**
     * 判断指派过该类别的空间是否有人员
     *
     * @param spaceCategoryId
     * @return Boolean
     * @Author: haomeijie
     * @Date: 2022/4/29 11:02
     */
    int checkCategoryExitStaff(String spaceCategoryId);
}
